library ( MASS );
source ( "{$html_root}/cgi-lib/R/ep.io.R" );

src = "{$src}";
filename = "{$filename}";
outputdir = "{$outputdir}";
title = "{$title}";
nbins = "{$nbins}";

m <- ep.readBin ( src );
bitmap ( height=3, width=3, file=paste ( "'", outputdir, "/", filename, ".hist.png'", sep=""), type="png256", bg="transparent" );

truehist ( m ,
          nbin=as.integer(nbins),
          xlab="");

s = round( sd(as.vector(m), na.rm=TRUE), digits=4);
n = round( mean(m, na.rm=TRUE), digits=4);
r = nrow(m);
c = ncol(m);

abline ( v=c(n-s,n+ s), col="red", lty=2 );
abline ( v=c(n-3*s,n+3*s), col="blue", lty=2 );

print ( paste ( "SD:", s ) );
print ( paste ( "MEAN:", n ) );
print ( paste ( "ROWS:", r ) );
print ( paste ( "COLS:", c ) );
print ( paste ( "Histogram in: ", outputdir, "/", filename, ".hist.png", sep="" ) );
